//2009/08/18 17:58:19
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class CheckFunction
{
public:
    int newFunction(string code)
    {
        int ret = 0;
        for (int i=0; i<code.size(); i++)
			ret += count(code[i]);
		return ret;
    }
private:
    int count(char ch)
    {
        switch (ch)
        {
        case '0':
            return 6;
        case '1':
            return 2;
        case '2':
            return 5;
        case '3':
            return 5;
        case '4':
            return 4;
        case '5':
            return 5;
        case '6':
            return 6;
        case '7':
            return 3;
        case '8':
            return 7;
        case '9':
            return 6;
        default:
            return -1;
        }
    }
};
